var express = require('express');
var app = express();
// get: all online device
app.get('/', function(req, res) {
	// res.end('hello');
	res.redirect(301, "http://www.baidu.com");
});

app.post('/post1', function(req, res) {
	res.redirect(301, "http://172.16.1.43:8080/post2");
});

app.post('/post2', function(req, res) {
	var data = '';
	req.on('data', function(chunk) {
		data += chunk;
	})
	req.on('end', function() {
		res.end('ok,post2,data=' + data);
	})
});

app.listen(8080);
console.log('express start at 8080');